Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@konsumation/model

Package Overview
Dependencies
Maintainers
2
Versions
134
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@konsumation/model

data model of the konsumation apps

  • 3.10.2
  • Source
  • npm
  • Socket score

Version published
Maintainers
2
Created
Source

npm License Typed with TypeScript bundlejs downloads Build Status Styled with prettier Commitizen friendly Known Vulnerabilities

@konsumation/model

Data model of the konsumation apps

API

Table of Contents

AttributeDefinition

Type: Object

Properties

  • type string
  • isKey boolean
  • writable boolean
  • mandatory boolean
  • default any? the default value

description

Type: AttributeDefinition

name

Type: AttributeDefinition

id

Type: AttributeDefinition

unit

Type: AttributeDefinition

Returns string

unit

Type: string?

schemaVersion

Type: AttributeDefinition

serial

Type: AttributeDefinition

validFrom

Type: AttributeDefinition

fractionalDigits

Type: AttributeDefinition

fractionalDigits

Type: number?

order

Type: AttributeDefinition

Base

attributeNames

Attribute names on the javascript side.

Returns Array<string>

getAttributes

Object keys are the mapped external attribute names.

Returns Object

setAttributes

Sets values with external attribute names.

Parameters

type

Returns string

attributes

Attribute definitions.

Returns Object

attributeNameMapping

Maping of attribute names from internal (javascript) to external (database).

Returns Object

attributeNames

Attribute names on the javascript side.

Returns Array<string>

Category

Extends Base

Value Category.

Parameters

name

Type: string

description

Type: string?

fractionalDigits

Type: number?

unit

Type: string?

order

Type: string?

write

Write into store.

Parameters
  • context any

delete

Delete Category from store.

Parameters
  • context any

meters

List assigned meters.

Parameters

Returns AsyncIterable<Meter>

meter

Deliver Meter for a given name.

Parameters

Returns Promise<(Meter | undefined)>

activeMeter

Currently active Meter.

Parameters
  • context any

Returns Promise<(Meter | undefined)>

addMeter

Add a meter to the category;

Parameters
  • values Object (optional, default {})

Returns Promise<Meter>

notes

All notes from all meters.

Parameters
  • context any

Returns AsyncIterable<Note>

values

All values from all meters.

Parameters
  • context any

Returns AsyncIterable<{date: Date, value: number}>

latestValue

Get the latest value.

Parameters
  • context any

Returns Promise<({date: Date, value: number} | undefined)>

writeValue

Add a value to the active meter.

Parameters

Returns Promise<any>

deleteValue

Delete a value from the active meter.

Parameters
  • context any
  • time Date

Returns Promise<any>

text

Text representation.

Parameters
  • context any

Returns AsyncIterable<string>

type

Name of the type in text dump

Returns string

SCHEMA_VERSION_2

Schema with type + name

Type: string

SCHEMA_VERSION_3

Values are attached to the meter. Value dates may be given as iso date.

Type: string

SCHEMA_VERSION_CURRENT

Schema version for newly created databases

Master

Extends Base

Parameters

  • values

Properties

write

Write attributes store.

Parameters
  • context any

close

addCategory

Add a category.

Parameters

Returns Promise<Category>

categories

Returns AsyncIterable<Category>

category

Parameters

Returns Promise<(Category | undefined)>

text

Create text representation

Returns AsyncIterable<string>

initialize

Parameters

Returns Promise<Master>

Meter

Extends Base

Parameters

name

Type: string

category

Type: Category

description

Type: string?

serial

Type: string?

validFrom

Type: Date?

write

Parameters
  • context any

delete

Parameters
  • context any

values

Parameters
  • context any

Returns AsyncIterable<{date: Date, value: number}>

writeValue

Write new value.

Parameters

deleteValue

Delete a value.

Parameters
  • context any
  • time Date

latestValue

Get the latest value.

Parameters
  • context any

Returns Promise<({date: Date, value: number} | undefined)>

notes

List assigned Notes.

Parameters

Returns AsyncIterable<Note>

note

Deliver Note for a given name.

Parameters

Returns Promise<(Note | undefined)>

addNote

Add a note to the meter;

Parameters
  • values Object (optional, default {})

Returns Promise<Note>

text

Text representation.

Parameters
  • context any

Returns AsyncIterable<string>

type

Name of the type in text dump

Returns string

Note

Extends Base

Parameters

name

Type: string

description

Type: string?

meter

Type: Meter

write

Write into store.

Parameters
  • context any

delete

Delete from store.

Parameters
  • context any

text

Text representation.

Parameters
  • context any

Returns AsyncIterable<string>

type

Name of the type in text dump

Returns string

toText

Text representation.

Parameters

  • context any
  • object Base
  • key string
  • iterators ...any

Returns AsyncIterable<string>

install

With npm do:

npm install @konsumation/model

license

BSD-2-Clause

FAQs

Package last updated on 13 Apr 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc